#include "Disc_C808.h"


void Disc_C808::SetThreshold(int channel, uint8_t value)
{
  threshold[channel] = value;
  camac.WriteLong(station, channel, 16, value);
}


void Disc_C808::SetInhibitPattern(uint16_t pattern)
{
  camac.WriteLong(station, 0, 17, pattern);
}


void Disc_C808::SetOutputWidth(int chrange, uint8_t value)
{
  outputWidth[chrange] = value;
  camac.WriteLong(station, chrange, 18, value);
}


void Disc_C808::SetDeadTime(int chrange, uint8_t value)
{
  deadTime[chrange] = value;
  camac.WriteLong(station, chrange, 19, value);
}


void Disc_C808::SetMajorityThreshold(uint8_t nchannels)
{
  majorityThreshold = nchannels;
  unsigned int majthr = 12 * nchannels + nchannels / 2  - 6;
  camac.WriteLong(station, 0, 20, majthr);
}


void Disc_C808::GenTestPulse()
{
  camac.WriteLong(station, 0, 25, 0);
}
